# -*- encoding: utf-8 -*-

from Common.mysql import db, ma
from sqlalchemy.dialects.mysql import LONGTEXT


# 新建表case_data
class BugData(db.Model):
    __tablename__ = 'bug_data'  # 数据库名称
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(255))
    describe = db.Column(LONGTEXT)
    projectId = db.Column(db.String(64))
    sprint = db.Column(db.String(255))
    severity = db.Column(db.String(255))
    level = db.Column(db.String(255))
    handler = db.Column(db.String(255))
    responsible = db.Column(db.String(255))
    bugType = db.Column(db.String(255))
    platform = db.Column(db.String(255))
    status = db.Column(db.String(64))
    delete = db.Column(db.String(64))
    is_reopen = db.Column(db.Integer)
    create_time = db.Column(db.DATETIME)
    create_user = db.Column(db.String(64))
    update_time = db.Column(db.DATETIME)
    update_user = db.Column(db.String(64))


class BugDataSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = BugData
